From 7597b899d6df359af976c8c248b6ee6087ec5370 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Mon, 28 Mar 2005 07:56:17 +0000 Subject: [PATCH] Fixed ordering of SQL debug log --- includes/Database.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/includes/Database.php b/includes/Database.php index f367cf9b4f..7fe6ae9158 100644 --- a/includes/Database.php +++ b/includes/Database.php @@ -280,16 +280,17 @@ class Database { } else { $commentedSql = $sql; } - if ( $this->debug() ) { - $sqlx = substr( $commentedSql, 0, 500 ); - $sqlx = strtr($sqlx,"\t\n",' '); - wfDebug( "SQL: $sqlx\n" ); - } - + # If DBO_TRX is set, start a transaction if ( ( $this->mFlags & DBO_TRX ) && !$this->trxLevel() && $sql != 'BEGIN' ) { $this->begin(); } + + if ( $this->debug() ) { + $sqlx = substr( $sql, 0, 500 ); + $sqlx = strtr($sqlx,"\t\n",' '); + wfDebug( "SQL: $sqlx\n" ); + } # Do the query and handle errors $ret = $this->doQuery( $commentedSql ); -- 2.20.1